package com.sunjob.mroresumeproject.service;

import com.sunjob.common.domain.mroresume.RPBus;
import com.sunjob.common.util.MROUtils;
import com.sunjob.mroresumeproject.dao.RPBusMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class RPBusServiceImpl implements RPBusService{

    @Autowired
    RPBusMapper rpBusMapper;

    @Override
    public int querycount(String types) {
        return rpBusMapper.querycount(types);
    }

    @Override
    public List<RPBus> queryrepair(int pages, int size,String types) {
        return rpBusMapper.queryrepair(pages,size,types);
    }

    @Override
    public List<RPBus> queryrepair2(String repairid) {

          return   rpBusMapper.queryrepair2(repairid);

    }

    @Override
    public void insertrepair(RPBus rpBus) {
        rpBus.setRepairid(MROUtils.nextId());
        rpBus.setStarttime(LocalDateTime.now());
        rpBus.setEndtime(LocalDateTime.now());
        rpBus.setStatus(1);
        rpBusMapper.insertrepair(rpBus);
    }



    @Override
    public List<RPBus> queryrepairone(Long repairid) {
        return rpBusMapper.queryrepairone(repairid);
    }

    @Override
    public void updaterepair(RPBus rpBus) {
       rpBusMapper.updaterepair(rpBus);
    }

    @Override
    public void deleterepair(String repairid) {
      rpBusMapper.deleterepair(repairid);
    }

    @Override
    public void deleterepairone(String s) {
        rpBusMapper.deleterepairone(s);
    }



}
